import 'package:flutter/material.dart';

class RecentActivities extends StatelessWidget {
  const RecentActivities({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        const Text(
          'ئەڭ يېقىنقى سودا ئەھۋالى',
          style: TextStyle(
            fontSize: 18,
            fontWeight: FontWeight.w500,
          ),
        ),
        const SizedBox(height: 16),
        Container(
          padding: const EdgeInsets.all(24),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: BorderRadius.circular(8),
            boxShadow: [
              BoxShadow(
                color: Colors.grey.withOpacity(0.1),
                blurRadius: 4,
                offset: const Offset(0, 2),
              ),
            ],
          ),
          child: Column(
            children: [
              _buildActivityItem(
                icon: Icons.shopping_cart,
                iconColor: Colors.blue,
                iconBgColor: Colors.blue.withOpacity(0.1),
                title: 'يېڭى مال كىرگۈزۈلدى',
                subtitle: 'ئەلى ئابدۇللا تەرىپىدىن',
                time: '5 مىنۇت بۇرۇن',
              ),
              const Divider(height: 32),
              _buildActivityItem(
                icon: Icons.check_circle,
                iconColor: Colors.green,
                iconBgColor: Colors.green.withOpacity(0.1),
                title: 'سودا تاماملاندى',
                subtitle: 'مەريەم ئەخمەت تەرىپىدىن',
                time: '15 مىنۇت بۇرۇن',
              ),
              const Divider(height: 32),
              _buildActivityItem(
                icon: Icons.local_shipping,
                iconColor: Colors.amber,
                iconBgColor: Colors.amber.withOpacity(0.1),
                title: 'مال يوللاندى',
                subtitle: 'ئايگۈل تۇرسۇن تەرىپىدىن',
                time: '30 مىنۇت بۇرۇن',
              ),
            ],
          ),
        ),
      ],
    );
  }

  // بىر پائالىيەت ئۇچۇرى
  Widget _buildActivityItem({
    required IconData icon,
    required Color iconColor,
    required Color iconBgColor,
    required String title,
    required String subtitle,
    required String time,
  }) {
    return Row(
      children: [
        Container(
          width: 40,
          height: 40,
          decoration: BoxDecoration(
            color: iconBgColor,
            borderRadius: BorderRadius.circular(20),
          ),
          child: Icon(
            icon,
            color: iconColor,
          ),
        ),
        const SizedBox(width: 16),
        Expanded(
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Text(
                title,
                style: const TextStyle(
                  fontWeight: FontWeight.w500,
                ),
                overflow: TextOverflow.ellipsis,
              ),
              Text(
                subtitle,
                style: TextStyle(
                  fontSize: 14,
                  color: Colors.grey[600],
                ),
                overflow: TextOverflow.ellipsis,
              ),
            ],
          ),
        ),
        const SizedBox(width: 16),
        Text(
          time,
          style: TextStyle(
            fontSize: 14,
            color: Colors.grey[600],
          ),
        ),
      ],
    );
  }
} 